package com.itheima.spring.bestpractive.common.exception;

import lombok.Getter;

/**
 * @version 1.0
 * @author: HZY
 * @date: 2025/6/24 23:25
 * @Content:
 */
@Getter
public class BizException extends RuntimeException{
    private final int code;
    private final String message;

    public BizException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public BizException(BizEnum bizEnum) {
        super(bizEnum.getMessage());
        this.code = bizEnum.getCode();
        this.message = bizEnum.getMessage();
    }
}
